package com.youxuan.controller;

import com.youxuan.pojo.entity.ResponseFormat;
import com.youxuan.pojo.entity.ResponseResult;
import com.youxuan.service.GeneralService;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
@Api(tags = "通用")
public class GeneralController {

    @Autowired
    private GeneralService generalService;

    @ApiOperation("文件上传")
    @ApiImplicitParam(name = "file",value = "文件",required = true,type = "MultipartFile")
    @PostMapping("/upload")
    public ResponseResult<ResponseFormat.UploadFormat> upload(MultipartFile file){
        return generalService.upload(file);
    }

}
